
namespace MyRI{
  template<class T,class Iterator>
  class Reverse_Iterator{
    public:
    Reverse_Iterator(const Iterator& it)
      :_r_iterator(it)
    {}
    //Reverse_Iterator(const Reverse_Iterator& rit)
    //  :_r_iterator(rit._r_iterator)
    //{}
    Reverse_Iterator& operator=(const Reverse_Iterator rit)
    {
      _r_iterator = rit._r_iterator;
      return *this; 
    }
    Reverse_Iterator& operator=(const Iterator it)
    {
      _r_iterator = it;
      return *this;
    }
    bool operator!=(const Reverse_Iterator& rit)
    {
      return (_r_iterator != rit._r_iterator);
    }
    Reverse_Iterator& operator++()
    {
      --_r_iterator;
      return *this;
    }
    Reverse_Iterator operator++(int)
    {
      Iterator tmp = _r_iterator;
      --_r_iterator;
      return Reverse_Iterator(tmp);
    }
    Reverse_Iterator& operator--()
    {
      ++_r_iterator;
      return *this;
    }
    Reverse_Iterator operator--(int)
    {
      Iterator tmp = _r_iterator;
      ++_r_iterator;
      return Reverse_Iterator(tmp);
    }
    T& operator*()
    {
      Iterator tmp = _r_iterator;
      return *(--tmp);
    }
    T* operator->()
    {
      Iterator tmp = _r_iterator;
      return &*(*--tmp);
    }
    private:
      Iterator _r_iterator;
  
  };
}
